package com.aiyige.model.request;

import com.aiyige.base.api.ApiManager;

import okhttp3.ResponseBody;
import retrofit2.Call;

/**
 * Created by zhuyakun on 2017/11/14.
 */

public class CreateTagRequest {
    String name;
    Integer groupId;
    Long categoryId;

    private CreateTagRequest(Builder builder) {
        setName(builder.name);
        setGroupId(builder.groupId);
        setCategoryId(builder.categoryId);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public static final class Builder {
        private String name;
        private Integer groupId;
        private Long categoryId;

        private Builder() {
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder groupId(Integer groupId) {
            this.groupId = groupId;
            return this;
        }

        public Builder categoryId(Long categoryId) {
            this.categoryId = categoryId;
            return this;
        }

        public Call<ResponseBody> build() {
            return ApiManager.getService().createTag(new CreateTagRequest(this));
        }
    }
}
